<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //数组的长度 数组名：length
        var arr = ['张飞', '马超', '刘备', '赵云', '黄忠', '姜维', '关羽'];
        for (var i = 0; i < 7; i++) {
            console.log(arr[i]);

        }
        console.log(arr.length);
        for (var i = 0; i < arr.length; i++) {
            console.log(arr[i]);
        }
        //1.数组的长度是元素的个数，不要跟索引号混淆
        //2.arr.length 动态监测数组元素的个数
    </script>
</head>

<body>

</body>

</html>